package com.zt.fbg.autogenerator.controller;


import com.zt.fbg.autogenerator.entity.TbUserEntity;
import com.zt.fbg.autogenerator.service.TbUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xhl
 * @since 2021-10-07
 */
@RestController
@RequestMapping("/autogenerator/tb-user-entity")
@Slf4j
@Api(tags = "批量插入")
public class TbUserController {

    @Resource
    TbUserService tbUserService;
    @ApiOperation("批量插入记录到tb_user表")
    @PostMapping("insert/tb/user")
    public void InsertTbUser(@RequestBody List<TbUserEntity> userEntityList){
        log.info("userEntityList:",userEntityList);
        boolean b = tbUserService.saveBatch(userEntityList);
        log.info("b:{}",b);
    }

}
